From 710b6f7c0cfc9ab300d03f12538da3e26c35207b Mon Sep 17 00:00:00 2001
From: Philipp Huebner <debalance@debian.org>
Date: Tue, 31 May 2022 10:30:52 +0200
Subject: [PATCH] correct includes

Many parts of ejabberd code were moved into their own projects and are
packaged separately by me. To make the build process work, several
includes must be adjusted for the corresponding libraries to be found.

Author: Philipp Huebner <debalance@debian.org>
Original: https://salsa.debian.org/ejabberd-packaging-team/ejabberd/-/blob/master/debian/patches/src.includes.patch
Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
[Bernd: updated for version 23.04]
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
 src/ejabberd_auth.erl             | 2 +-
 src/ejabberd_auth_anonymous.erl   | 2 +-
 src/ejabberd_auth_jwt.erl         | 2 +-
 src/ejabberd_auth_mnesia.erl      | 2 +-
 src/ejabberd_auth_sql.erl         | 2 +-
 src/ejabberd_bosh.erl             | 2 +-
 src/ejabberd_c2s.erl              | 2 +-
 src/ejabberd_captcha.erl          | 2 +-
 src/ejabberd_http.erl             | 2 +-
 src/ejabberd_http_ws.erl          | 2 +-
 src/ejabberd_iq.erl               | 2 +-
 src/ejabberd_local.erl            | 2 +-
 src/ejabberd_oauth.erl            | 2 +-
 src/ejabberd_oauth_rest.erl       | 2 +-
 src/ejabberd_oauth_sql.erl        | 2 +-
 src/ejabberd_piefxis.erl          | 4 ++--
 src/ejabberd_router.erl           | 2 +-
 src/ejabberd_router_multicast.erl | 2 +-
 src/ejabberd_s2s.erl              | 2 +-
 src/ejabberd_s2s_in.erl           | 2 +-
 src/ejabberd_s2s_out.erl          | 2 +-
 src/ejabberd_service.erl          | 2 +-
 src/ejabberd_sm.erl               | 2 +-
 src/ejabberd_web.erl              | 2 +-
 src/ejabberd_web_admin.erl        | 2 +-
 src/ejabberd_websocket.erl        | 2 +-
 src/ejabberd_xmlrpc.erl           | 2 +-
 src/ext_mod.erl                   | 2 +-
 src/gen_iq_handler.erl            | 2 +-
 src/gen_pubsub_node.erl           | 2 +-
 src/gen_pubsub_nodetree.erl       | 2 +-
 src/jd2ejd.erl                    | 2 +-
 src/misc.erl                      | 2 +-
 src/mod_adhoc.erl                 | 2 +-
 src/mod_admin_extra.erl           | 2 +-
 src/mod_admin_update_sql.erl      | 2 +-
 src/mod_announce.erl              | 2 +-
 src/mod_announce_mnesia.erl       | 2 +-
 src/mod_announce_sql.erl          | 2 +-
 src/mod_avatar.erl                | 2 +-
 src/mod_block_strangers.erl       | 2 +-
 src/mod_blocking.erl              | 2 +-
 src/mod_bosh.erl                  | 2 +-
 src/mod_caps.erl                  | 2 +-
 src/mod_carboncopy.erl            | 2 +-
 src/mod_client_state.erl          | 2 +-
 src/mod_configure.erl             | 2 +-
 src/mod_conversejs.erl            | 2 +-
 src/mod_delegation.erl            | 2 +-
 src/mod_disco.erl                 | 2 +-
 src/mod_fail2ban.erl              | 2 +-
 src/mod_host_meta.erl             | 2 +-
 src/mod_http_api.erl              | 2 +-
 src/mod_http_upload.erl           | 2 +-
 src/mod_http_upload_quota.erl     | 2 +-
 src/mod_jidprep.erl               | 2 +-
 src/mod_last.erl                  | 2 +-
 src/mod_legacy_auth.erl           | 2 +-
 src/mod_mam.erl                   | 2 +-
 src/mod_mam_mnesia.erl            | 2 +-
 src/mod_mam_sql.erl               | 2 +-
 src/mod_metrics.erl               | 2 +-
 src/mod_mix.erl                   | 2 +-
 src/mod_mix_pam.erl               | 2 +-
 src/mod_mqtt_bridge_session.erl   | 2 +-
 src/mod_mqtt_session.erl          | 2 +-
 src/mod_mqtt_ws.erl               | 2 +-
 src/mod_muc.erl                   | 2 +-
 src/mod_muc_admin.erl             | 2 +-
 src/mod_muc_log.erl               | 2 +-
 src/mod_muc_mnesia.erl            | 2 +-
 src/mod_muc_room.erl              | 2 +-
 src/mod_muc_rtbl.erl              | 2 +-
 src/mod_muc_sql.erl               | 2 +-
 src/mod_multicast.erl             | 2 +-
 src/mod_offline.erl               | 2 +-
 src/mod_offline_mnesia.erl        | 2 +-
 src/mod_offline_sql.erl           | 2 +-
 src/mod_ping.erl                  | 2 +-
 src/mod_pres_counter.erl          | 2 +-
 src/mod_privacy.erl               | 2 +-
 src/mod_privacy_mnesia.erl        | 2 +-
 src/mod_privacy_sql.erl           | 2 +-
 src/mod_private.erl               | 2 +-
 src/mod_private_mnesia.erl        | 2 +-
 src/mod_private_sql.erl           | 2 +-
 src/mod_privilege.erl             | 2 +-
 src/mod_proxy65_service.erl       | 2 +-
 src/mod_pubsub.erl                | 2 +-
 src/mod_push.erl                  | 2 +-
 src/mod_push_keepalive.erl        | 2 +-
 src/mod_push_mnesia.erl           | 2 +-
 src/mod_push_sql.erl              | 2 +-
 src/mod_register.erl              | 2 +-
 src/mod_register_web.erl          | 2 +-
 src/mod_roster.erl                | 2 +-
 src/mod_roster_mnesia.erl         | 2 +-
 src/mod_roster_sql.erl            | 2 +-
 src/mod_s2s_dialback.erl          | 2 +-
 src/mod_service_log.erl           | 2 +-
 src/mod_shared_roster.erl         | 2 +-
 src/mod_shared_roster_ldap.erl    | 2 +-
 src/mod_shared_roster_mnesia.erl  | 2 +-
 src/mod_shared_roster_sql.erl     | 2 +-
 src/mod_sic.erl                   | 2 +-
 src/mod_sip.erl                   | 2 +-
 src/mod_sip_proxy.erl             | 2 +-
 src/mod_sip_registrar.erl         | 2 +-
 src/mod_stats.erl                 | 2 +-
 src/mod_stream_mgmt.erl           | 2 +-
 src/mod_stun_disco.erl            | 2 +-
 src/mod_time.erl                  | 2 +-
 src/mod_vcard.erl                 | 2 +-
 src/mod_vcard_ldap.erl            | 2 +-
 src/mod_vcard_mnesia.erl          | 2 +-
 src/mod_vcard_sql.erl             | 2 +-
 src/mod_vcard_xupdate.erl         | 2 +-
 src/mod_version.erl               | 2 +-
 src/node_flat.erl                 | 2 +-
 src/node_flat_sql.erl             | 2 +-
 src/nodetree_tree.erl             | 2 +-
 src/nodetree_tree_sql.erl         | 2 +-
 src/prosody2ejabberd.erl          | 4 ++--
 src/pubsub_subscription.erl       | 2 +-
 src/pubsub_subscription_sql.erl   | 2 +-
 test/suite.hrl                    | 8 ++++----
 tools/xml_compress_gen.erl        | 2 +-
 127 files changed, 132 insertions(+), 132 deletions(-)

diff --git a/src/ejabberd_auth.erl b/src/ejabberd_auth.erl
index 027983e61..06150f34a 100644
--- a/src/ejabberd_auth.erl
+++ b/src/ejabberd_auth.erl
@@ -50,7 +50,7 @@
 
 -export([auth_modules/1, convert_to_scram/1]).
 
--include_lib("xmpp/include/scram.hrl").
+-include_lib("p1_xmpp/include/scram.hrl").
 -include("logger.hrl").
 
 -define(SALT_LENGTH, 16).
diff --git a/src/ejabberd_auth_anonymous.erl b/src/ejabberd_auth_anonymous.erl
index 056d475f8..9284c10f6 100644
--- a/src/ejabberd_auth_anonymous.erl
+++ b/src/ejabberd_auth_anonymous.erl
@@ -45,7 +45,7 @@
 	 plain_password_required/1]).
 
 -include("logger.hrl").
--include_lib("xmpp/include/jid.hrl").
+-include_lib("p1_xmpp/include/jid.hrl").
 
 start(Host) ->
     ejabberd_hooks:add(sm_register_connection_hook, Host,
diff --git a/src/ejabberd_auth_jwt.erl b/src/ejabberd_auth_jwt.erl
index e4b251a03..8074d8612 100644
--- a/src/ejabberd_auth_jwt.erl
+++ b/src/ejabberd_auth_jwt.erl
@@ -36,7 +36,7 @@
 %% 'ejabberd_hooks' callback:
 -export([check_decoded_jwt/5]).
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("logger.hrl").
 
 %%%----------------------------------------------------------------------
diff --git a/src/ejabberd_auth_mnesia.erl b/src/ejabberd_auth_mnesia.erl
index d52dde868..468ae4b19 100644
--- a/src/ejabberd_auth_mnesia.erl
+++ b/src/ejabberd_auth_mnesia.erl
@@ -37,7 +37,7 @@
 -export([need_transform/1, transform/1]).
 
 -include("logger.hrl").
--include_lib("xmpp/include/scram.hrl").
+-include_lib("p1_xmpp/include/scram.hrl").
 -include("ejabberd_auth.hrl").
 
 -record(reg_users_counter, {vhost = <<"">> :: binary(),
diff --git a/src/ejabberd_auth_sql.erl b/src/ejabberd_auth_sql.erl
index 566152695..a730d61bc 100644
--- a/src/ejabberd_auth_sql.erl
+++ b/src/ejabberd_auth_sql.erl
@@ -35,7 +35,7 @@
 	 remove_user/2, store_type/1, plain_password_required/1,
 	 export/1, which_users_exists/2]).
 
--include_lib("xmpp/include/scram.hrl").
+-include_lib("p1_xmpp/include/scram.hrl").
 -include("logger.hrl").
 -include("ejabberd_sql_pt.hrl").
 -include("ejabberd_auth.hrl").
diff --git a/src/ejabberd_bosh.erl b/src/ejabberd_bosh.erl
index 06aaacda9..e0c72f74b 100644
--- a/src/ejabberd_bosh.erl
+++ b/src/ejabberd_bosh.erl
@@ -43,7 +43,7 @@
 	 code_change/4]).
 
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("ejabberd_http.hrl").
 -include("bosh.hrl").
 
diff --git a/src/ejabberd_c2s.erl b/src/ejabberd_c2s.erl
index d7b3a3340..670e57516 100644
--- a/src/ejabberd_c2s.erl
+++ b/src/ejabberd_c2s.erl
@@ -51,7 +51,7 @@
 	 reply/2, copy_state/2, set_timeout/2, route/2, format_reason/2,
 	 host_up/1, host_down/1, send_ws_ping/1, bounce_message_queue/2]).
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("logger.hrl").
 -include("mod_roster.hrl").
 -include("translate.hrl").
diff --git a/src/ejabberd_captcha.erl b/src/ejabberd_captcha.erl
index 12ab5abb8..e2d400a48 100644
--- a/src/ejabberd_captcha.erl
+++ b/src/ejabberd_captcha.erl
@@ -42,7 +42,7 @@
 	 host_up/1, host_down/1,
 	 config_reloaded/0, process_iq/1]).
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("logger.hrl").
 -include("ejabberd_http.hrl").
 -include("translate.hrl").
diff --git a/src/ejabberd_http.erl b/src/ejabberd_http.erl
index f29f36063..34ac89190 100644
--- a/src/ejabberd_http.erl
+++ b/src/ejabberd_http.erl
@@ -37,7 +37,7 @@
 -export([init/3]).
 
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("ejabberd_http.hrl").
 -include("ejabberd_stacktrace.hrl").
 -include_lib("kernel/include/file.hrl").
diff --git a/src/ejabberd_http_ws.erl b/src/ejabberd_http_ws.erl
index e14ca69e6..83986a69b 100644
--- a/src/ejabberd_http_ws.erl
+++ b/src/ejabberd_http_ws.erl
@@ -36,7 +36,7 @@
 
 -include("logger.hrl").
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 
 -include("ejabberd_http.hrl").
 
diff --git a/src/ejabberd_iq.erl b/src/ejabberd_iq.erl
index b4957dd55..53f476962 100644
--- a/src/ejabberd_iq.erl
+++ b/src/ejabberd_iq.erl
@@ -34,7 +34,7 @@
 -export([init/1, handle_call/3, handle_cast/2, handle_info/2,
 	 terminate/2, code_change/3]).
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("logger.hrl").
 -include("ejabberd_stacktrace.hrl").
 
diff --git a/src/ejabberd_local.erl b/src/ejabberd_local.erl
index 5147a7481..7376acbd7 100644
--- a/src/ejabberd_local.erl
+++ b/src/ejabberd_local.erl
@@ -47,7 +47,7 @@
 
 -include("logger.hrl").
 -include_lib("stdlib/include/ms_transform.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("ejabberd_stacktrace.hrl").
 -include("translate.hrl").
 
diff --git a/src/ejabberd_oauth.erl b/src/ejabberd_oauth.erl
index ba369c1f2..6f4f6d9c8 100644
--- a/src/ejabberd_oauth.erl
+++ b/src/ejabberd_oauth.erl
@@ -54,7 +54,7 @@
          oauth_add_client_implicit/3,
          oauth_remove_client/1]).
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("logger.hrl").
 -include("ejabberd_http.hrl").
 -include("ejabberd_web_admin.hrl").
diff --git a/src/ejabberd_oauth_rest.erl b/src/ejabberd_oauth_rest.erl
index 1a18e2655..36301cfaf 100644
--- a/src/ejabberd_oauth_rest.erl
+++ b/src/ejabberd_oauth_rest.erl
@@ -36,7 +36,7 @@
 
 -include("ejabberd_oauth.hrl").
 -include("logger.hrl").
--include_lib("xmpp/include/jid.hrl").
+-include_lib("p1_xmpp/include/jid.hrl").
 
 init() ->
     rest:start(ejabberd_config:get_myname()),
diff --git a/src/ejabberd_oauth_sql.erl b/src/ejabberd_oauth_sql.erl
index ecb1625c7..8513a430b 100644
--- a/src/ejabberd_oauth_sql.erl
+++ b/src/ejabberd_oauth_sql.erl
@@ -37,7 +37,7 @@
 
 -include("ejabberd_oauth.hrl").
 -include("ejabberd_sql_pt.hrl").
--include_lib("xmpp/include/jid.hrl").
+-include_lib("p1_xmpp/include/jid.hrl").
 -include("logger.hrl").
 
 init() ->
diff --git a/src/ejabberd_piefxis.erl b/src/ejabberd_piefxis.erl
index 01fa24852..5ce3077d5 100644
--- a/src/ejabberd_piefxis.erl
+++ b/src/ejabberd_piefxis.erl
@@ -38,9 +38,9 @@
 
 -define(CHUNK_SIZE, 1024*20). %20k
 
--include_lib("xmpp/include/scram.hrl").
+-include_lib("p1_xmpp/include/scram.hrl").
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("mod_privacy.hrl").
 -include("mod_roster.hrl").
 
diff --git a/src/ejabberd_router.erl b/src/ejabberd_router.erl
index 3a2c6f318..b80e893cc 100644
--- a/src/ejabberd_router.erl
+++ b/src/ejabberd_router.erl
@@ -69,7 +69,7 @@
 
 -include("logger.hrl").
 -include("ejabberd_router.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("ejabberd_stacktrace.hrl").
 
 -callback init() -> any().
diff --git a/src/ejabberd_router_multicast.erl b/src/ejabberd_router_multicast.erl
index 773a3788e..ab341df09 100644
--- a/src/ejabberd_router_multicast.erl
+++ b/src/ejabberd_router_multicast.erl
@@ -42,7 +42,7 @@
 	 terminate/2, code_change/3, update_to_in_wrapped/2]).
 
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 
 -record(route_multicast, {domain = <<"">> :: binary() | '_',
 			  pid = self() :: pid()}).
diff --git a/src/ejabberd_s2s.erl b/src/ejabberd_s2s.erl
index 378a55a43..a31e2d14d 100644
--- a/src/ejabberd_s2s.erl
+++ b/src/ejabberd_s2s.erl
@@ -52,7 +52,7 @@
 -export([get_info_s2s_connections/1]).
 
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("ejabberd_commands.hrl").
 -include_lib("stdlib/include/ms_transform.hrl").
 -include("ejabberd_stacktrace.hrl").
diff --git a/src/ejabberd_s2s_in.erl b/src/ejabberd_s2s_in.erl
index ab8bb4503..7e8aa79b0 100644
--- a/src/ejabberd_s2s_in.erl
+++ b/src/ejabberd_s2s_in.erl
@@ -41,7 +41,7 @@
 -export([stop_async/1, close/1, close/2, send/2, update_state/2, establish/1,
 	 host_up/1, host_down/1]).
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("logger.hrl").
 
 -type state() :: xmpp_stream_in:state().
diff --git a/src/ejabberd_s2s_out.erl b/src/ejabberd_s2s_out.erl
index b9ae1abb3..dadd50a6f 100644
--- a/src/ejabberd_s2s_out.erl
+++ b/src/ejabberd_s2s_out.erl
@@ -39,7 +39,7 @@
 -export([start/3, start_link/3, connect/1, close/1, close/2, stop_async/1, send/2,
 	 route/2, establish/1, update_state/2, host_up/1, host_down/1]).
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("logger.hrl").
 -include("translate.hrl").
 
diff --git a/src/ejabberd_service.erl b/src/ejabberd_service.erl
index 3afa64f37..14c0259df 100644
--- a/src/ejabberd_service.erl
+++ b/src/ejabberd_service.erl
@@ -35,7 +35,7 @@
 %% API
 -export([send/2, close/1, close/2, stop_async/1]).
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("logger.hrl").
 -include("translate.hrl").
 
diff --git a/src/ejabberd_sm.erl b/src/ejabberd_sm.erl
index c9317b81c..6464801fe 100644
--- a/src/ejabberd_sm.erl
+++ b/src/ejabberd_sm.erl
@@ -85,7 +85,7 @@
 	 handle_info/2, terminate/2, code_change/3]).
 
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("ejabberd_commands.hrl").
 -include("ejabberd_sm.hrl").
 -include("ejabberd_stacktrace.hrl").
diff --git a/src/ejabberd_web.erl b/src/ejabberd_web.erl
index 5152e2b38..a2cf3c682 100644
--- a/src/ejabberd_web.erl
+++ b/src/ejabberd_web.erl
@@ -33,7 +33,7 @@
 
 -include("logger.hrl").
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 
 -include("ejabberd_http.hrl").
 
diff --git a/src/ejabberd_web_admin.erl b/src/ejabberd_web_admin.erl
index ac3d4ec9b..e63231a46 100644
--- a/src/ejabberd_web_admin.erl
+++ b/src/ejabberd_web_admin.erl
@@ -35,7 +35,7 @@
 
 -include("logger.hrl").
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 
 -include("ejabberd_http.hrl").
 
diff --git a/src/ejabberd_websocket.erl b/src/ejabberd_websocket.erl
index 21123eb23..b9df5304b 100644
--- a/src/ejabberd_websocket.erl
+++ b/src/ejabberd_websocket.erl
@@ -46,7 +46,7 @@
 
 -include("logger.hrl").
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 
 -include("ejabberd_http.hrl").
 
diff --git a/src/ejabberd_xmlrpc.erl b/src/ejabberd_xmlrpc.erl
index 741bf8422..78f001d24 100644
--- a/src/ejabberd_xmlrpc.erl
+++ b/src/ejabberd_xmlrpc.erl
@@ -39,7 +39,7 @@
 -include("ejabberd_http.hrl").
 -include("mod_roster.hrl").
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 
 -record(state,
 	{auth = noauth        :: noauth | map(),
diff --git a/src/ext_mod.erl b/src/ext_mod.erl
index 32f1f6fc8..066b40935 100644
--- a/src/ext_mod.erl
+++ b/src/ext_mod.erl
@@ -46,7 +46,7 @@
 -include("ejabberd_web_admin.hrl").
 -include("logger.hrl").
 -include("translate.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 
 -define(REPOS, "https://github.com/processone/ejabberd-contrib").
 
diff --git a/src/gen_iq_handler.erl b/src/gen_iq_handler.erl
index 72fc0ae30..27c517493 100644
--- a/src/gen_iq_handler.erl
+++ b/src/gen_iq_handler.erl
@@ -35,7 +35,7 @@
 -deprecated([{add_iq_handler, 6}, {handle, 5}, {iqdisc, 1}]).
 
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("translate.hrl").
 -include("ejabberd_stacktrace.hrl").
 
diff --git a/src/gen_pubsub_node.erl b/src/gen_pubsub_node.erl
index baf0ae444..5b3fd426a 100644
--- a/src/gen_pubsub_node.erl
+++ b/src/gen_pubsub_node.erl
@@ -25,7 +25,7 @@
 
 -module(gen_pubsub_node).
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 
 -type(host() :: mod_pubsub:host()).
 -type(nodeId() :: mod_pubsub:nodeId()).
diff --git a/src/gen_pubsub_nodetree.erl b/src/gen_pubsub_nodetree.erl
index 1fd198208..821cdac45 100644
--- a/src/gen_pubsub_nodetree.erl
+++ b/src/gen_pubsub_nodetree.erl
@@ -36,7 +36,7 @@
 	ServerHost :: binary(),
 	Opts :: [any()]) -> atom().
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 
 -callback terminate(Host :: host(), ServerHost :: binary()) -> atom().
 
diff --git a/src/jd2ejd.erl b/src/jd2ejd.erl
index 1a8dbb87a..390abcc8a 100644
--- a/src/jd2ejd.erl
+++ b/src/jd2ejd.erl
@@ -31,7 +31,7 @@
 -export([import_file/1, import_dir/1]).
 
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 
 %%%----------------------------------------------------------------------
 %%% API
diff --git a/src/misc.erl b/src/misc.erl
index c08610524..d812865ba 100644
--- a/src/misc.erl
+++ b/src/misc.erl
@@ -51,7 +51,7 @@
 	     {encode_base64, 1}]).
 
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include_lib("kernel/include/file.hrl").
 
 -type distance_cache() :: #{{string(), string()} => non_neg_integer()}.
diff --git a/src/mod_adhoc.erl b/src/mod_adhoc.erl
index 3075366c4..2ad402cd7 100644
--- a/src/mod_adhoc.erl
+++ b/src/mod_adhoc.erl
@@ -39,7 +39,7 @@
 	 mod_options/1, mod_doc/0]).
 
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("translate.hrl").
 
 start(Host, _Opts) ->
diff --git a/src/mod_admin_extra.erl b/src/mod_admin_extra.erl
index 9b88176fb..c49d5400b 100644
--- a/src/mod_admin_extra.erl
+++ b/src/mod_admin_extra.erl
@@ -85,7 +85,7 @@
 -include("mod_roster.hrl").
 -include("mod_privacy.hrl").
 -include("ejabberd_sm.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 
 %%%
 %%% gen_mod
diff --git a/src/mod_admin_update_sql.erl b/src/mod_admin_update_sql.erl
index 74d30b3e3..5d7528fc5 100644
--- a/src/mod_admin_update_sql.erl
+++ b/src/mod_admin_update_sql.erl
@@ -39,7 +39,7 @@
 
 -include("logger.hrl").
 -include("ejabberd_commands.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("ejabberd_sql_pt.hrl").
 -include("translate.hrl").
 
diff --git a/src/mod_announce.erl b/src/mod_announce.erl
index 7f6df0df5..56db12f0b 100644
--- a/src/mod_announce.erl
+++ b/src/mod_announce.erl
@@ -51,7 +51,7 @@
 	 announce_all_hosts_motd_delete/1]).
 
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("mod_announce.hrl").
 -include("translate.hrl").
 
diff --git a/src/mod_announce_mnesia.erl b/src/mod_announce_mnesia.erl
index e0ef13907..c5ec48921 100644
--- a/src/mod_announce_mnesia.erl
+++ b/src/mod_announce_mnesia.erl
@@ -31,7 +31,7 @@
 	 get_motd/1, is_motd_user/2, set_motd_user/2, import/3]).
 -export([need_transform/1, transform/1]).
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("mod_announce.hrl").
 -include("logger.hrl").
 
diff --git a/src/mod_announce_sql.erl b/src/mod_announce_sql.erl
index 20ec78295..2aa8b112c 100644
--- a/src/mod_announce_sql.erl
+++ b/src/mod_announce_sql.erl
@@ -32,7 +32,7 @@
 	 get_motd/1, is_motd_user/2, set_motd_user/2, import/3,
 	 export/1]).
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("mod_announce.hrl").
 -include("ejabberd_sql_pt.hrl").
 -include("logger.hrl").
diff --git a/src/mod_avatar.erl b/src/mod_avatar.erl
index 58b4a8af6..1d01e867a 100644
--- a/src/mod_avatar.erl
+++ b/src/mod_avatar.erl
@@ -31,7 +31,7 @@
 -export([pubsub_publish_item/6, vcard_iq_convert/1, vcard_iq_publish/1,
 	 get_sm_features/5]).
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("logger.hrl").
 -include("pubsub.hrl").
 -include("translate.hrl").
diff --git a/src/mod_block_strangers.erl b/src/mod_block_strangers.erl
index 8595b4aa0..ba01af0f9 100644
--- a/src/mod_block_strangers.erl
+++ b/src/mod_block_strangers.erl
@@ -34,7 +34,7 @@
 
 -export([filter_packet/1, filter_offline_msg/1, filter_subscription/2]).
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("logger.hrl").
 -include("translate.hrl").
 
diff --git a/src/mod_blocking.erl b/src/mod_blocking.erl
index 75f9aa0b9..42e7281a4 100644
--- a/src/mod_blocking.erl
+++ b/src/mod_blocking.erl
@@ -33,7 +33,7 @@
 	 disco_features/5, mod_options/1, mod_doc/0]).
 
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("mod_privacy.hrl").
 -include("translate.hrl").
 
diff --git a/src/mod_bosh.erl b/src/mod_bosh.erl
index dfe7482e3..6f5db9417 100644
--- a/src/mod_bosh.erl
+++ b/src/mod_bosh.erl
@@ -40,7 +40,7 @@
 
 -include("logger.hrl").
 -include_lib("stdlib/include/ms_transform.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("ejabberd_http.hrl").
 -include("bosh.hrl").
 -include("translate.hrl").
diff --git a/src/mod_caps.erl b/src/mod_caps.erl
index 65287826c..58c573502 100644
--- a/src/mod_caps.erl
+++ b/src/mod_caps.erl
@@ -54,7 +54,7 @@
 
 -include("logger.hrl").
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("mod_caps.hrl").
 -include("translate.hrl").
 
diff --git a/src/mod_carboncopy.erl b/src/mod_carboncopy.erl
index c9fe73b0a..ad9524428 100644
--- a/src/mod_carboncopy.erl
+++ b/src/mod_carboncopy.erl
@@ -42,7 +42,7 @@
 -export([list/2]).
 
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("translate.hrl").
 
 -type direction() :: sent | received.
diff --git a/src/mod_client_state.erl b/src/mod_client_state.erl
index 5b38560e3..5fa594eff 100644
--- a/src/mod_client_state.erl
+++ b/src/mod_client_state.erl
@@ -42,7 +42,7 @@
 	 c2s_copy_session/2, c2s_session_resumed/1]).
 
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("translate.hrl").
 
 -define(CSI_QUEUE_MAX, 100).
diff --git a/src/mod_configure.erl b/src/mod_configure.erl
index 3aec8e106..624e6ee8e 100644
--- a/src/mod_configure.erl
+++ b/src/mod_configure.erl
@@ -39,7 +39,7 @@
 	 depends/2, mod_doc/0]).
 
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("ejabberd_sm.hrl").
 -include("translate.hrl").
 -include_lib("stdlib/include/ms_transform.hrl").
diff --git a/src/mod_conversejs.erl b/src/mod_conversejs.erl
index 64e2a48d0..6b40d1ee4 100644
--- a/src/mod_conversejs.erl
+++ b/src/mod_conversejs.erl
@@ -32,7 +32,7 @@
 -export([start/2, stop/1, reload/3, process/2, depends/2,
          mod_opt_type/1, mod_options/1, mod_doc/0]).
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("logger.hrl").
 -include("ejabberd_http.hrl").
 -include("translate.hrl").
diff --git a/src/mod_delegation.erl b/src/mod_delegation.erl
index 919c53a7b..c84d4a062 100644
--- a/src/mod_delegation.erl
+++ b/src/mod_delegation.erl
@@ -42,7 +42,7 @@
 	 disco_local_identity/5, disco_sm_identity/5]).
 
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("translate.hrl").
 
 -type route_type() :: ejabberd_sm | ejabberd_local.
diff --git a/src/mod_disco.erl b/src/mod_disco.erl
index 2b77cf762..0d8cd4749 100644
--- a/src/mod_disco.erl
+++ b/src/mod_disco.erl
@@ -42,7 +42,7 @@
 
 -include("logger.hrl").
 -include("translate.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include_lib("stdlib/include/ms_transform.hrl").
 -include("mod_roster.hrl").
 
diff --git a/src/mod_fail2ban.erl b/src/mod_fail2ban.erl
index cd5fb07fc..8d09b2f15 100644
--- a/src/mod_fail2ban.erl
+++ b/src/mod_fail2ban.erl
@@ -42,7 +42,7 @@
 -include_lib("stdlib/include/ms_transform.hrl").
 -include("ejabberd_commands.hrl").
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("translate.hrl").
 
 -define(CLEAN_INTERVAL, timer:minutes(10)).
diff --git a/src/mod_host_meta.erl b/src/mod_host_meta.erl
index e1f7f141b..357dc7661 100644
--- a/src/mod_host_meta.erl
+++ b/src/mod_host_meta.erl
@@ -38,7 +38,7 @@
 
 -include("logger.hrl").
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 
 -include("ejabberd_http.hrl").
 
diff --git a/src/mod_http_api.erl b/src/mod_http_api.erl
index 514a8632c..62030a16f 100644
--- a/src/mod_http_api.erl
+++ b/src/mod_http_api.erl
@@ -33,7 +33,7 @@
          format_arg/2,
 	 mod_options/1, mod_doc/0]).
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("logger.hrl").
 -include("ejabberd_http.hrl").
 -include("ejabberd_stacktrace.hrl").
diff --git a/src/mod_http_upload.erl b/src/mod_http_upload.erl
index 4efce9c5c..53072cd1e 100644
--- a/src/mod_http_upload.erl
+++ b/src/mod_http_upload.erl
@@ -87,7 +87,7 @@
 	 expand_host/2]).
 
 -include("ejabberd_http.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("logger.hrl").
 -include("translate.hrl").
 
diff --git a/src/mod_http_upload_quota.erl b/src/mod_http_upload_quota.erl
index 7c2742280..b803e34e0 100644
--- a/src/mod_http_upload_quota.erl
+++ b/src/mod_http_upload_quota.erl
@@ -51,7 +51,7 @@
 %% ejabberd_hooks callback.
 -export([handle_slot_request/6]).
 
--include_lib("xmpp/include/jid.hrl").
+-include_lib("p1_xmpp/include/jid.hrl").
 -include("logger.hrl").
 -include("translate.hrl").
 -include_lib("kernel/include/file.hrl").
diff --git a/src/mod_jidprep.erl b/src/mod_jidprep.erl
index c1b2ad1ec..029be581d 100644
--- a/src/mod_jidprep.erl
+++ b/src/mod_jidprep.erl
@@ -41,7 +41,7 @@
 
 -include("logger.hrl").
 -include("translate.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 
 %%--------------------------------------------------------------------
 %% gen_mod callbacks.
diff --git a/src/mod_last.erl b/src/mod_last.erl
index be7abd561..a23346f1a 100644
--- a/src/mod_last.erl
+++ b/src/mod_last.erl
@@ -38,7 +38,7 @@
 	 register_user/2, depends/2, privacy_check_packet/4]).
 
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("mod_privacy.hrl").
 -include("mod_last.hrl").
 -include("translate.hrl").
diff --git a/src/mod_legacy_auth.erl b/src/mod_legacy_auth.erl
index 98daa18ad..d2239ce2b 100644
--- a/src/mod_legacy_auth.erl
+++ b/src/mod_legacy_auth.erl
@@ -29,7 +29,7 @@
 %% hooks
 -export([c2s_unauthenticated_packet/2, c2s_stream_features/2]).
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("translate.hrl").
 
 -type c2s_state() :: ejabberd_c2s:state().
diff --git a/src/mod_mam.erl b/src/mod_mam.erl
index 7c40b17fc..3ba1448e8 100644
--- a/src/mod_mam.erl
+++ b/src/mod_mam.erl
@@ -48,7 +48,7 @@
 	 delete_old_messages_batch/5, delete_old_messages_status/1, delete_old_messages_abort/1,
 	 remove_message_from_archive/3]).
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("logger.hrl").
 -include("mod_muc_room.hrl").
 -include("ejabberd_commands.hrl").
diff --git a/src/mod_mam_mnesia.erl b/src/mod_mam_mnesia.erl
index f9e366860..c7340d0a9 100644
--- a/src/mod_mam_mnesia.erl
+++ b/src/mod_mam_mnesia.erl
@@ -32,7 +32,7 @@
 	 is_empty_for_user/2, is_empty_for_room/3, delete_old_messages_batch/5]).
 
 -include_lib("stdlib/include/ms_transform.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("logger.hrl").
 -include("mod_mam.hrl").
 
diff --git a/src/mod_mam_sql.erl b/src/mod_mam_sql.erl
index b21e84a7b..626b87d65 100644
--- a/src/mod_mam_sql.erl
+++ b/src/mod_mam_sql.erl
@@ -34,7 +34,7 @@
 	 delete_old_messages_batch/4, count_messages_to_delete/3]).
 
 -include_lib("stdlib/include/ms_transform.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("mod_mam.hrl").
 -include("logger.hrl").
 -include("ejabberd_sql_pt.hrl").
diff --git a/src/mod_metrics.erl b/src/mod_metrics.erl
index e3dd397f7..df333038a 100644
--- a/src/mod_metrics.erl
+++ b/src/mod_metrics.erl
@@ -29,7 +29,7 @@
 -behaviour(gen_mod).
 
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("translate.hrl").
 
 -export([start/2, stop/1, mod_opt_type/1, mod_options/1, depends/2, reload/3]).
diff --git a/src/mod_mix.erl b/src/mod_mix.erl
index 7066911b9..51ed5e1fb 100644
--- a/src/mod_mix.erl
+++ b/src/mod_mix.erl
@@ -41,7 +41,7 @@
 	 process_mam_query/1,
 	 process_pubsub_query/1]).
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("logger.hrl").
 -include("translate.hrl").
 -include("ejabberd_stacktrace.hrl").
diff --git a/src/mod_mix_pam.erl b/src/mod_mix_pam.erl
index 7bd6f2a71..a5bc5860f 100644
--- a/src/mod_mix_pam.erl
+++ b/src/mod_mix_pam.erl
@@ -36,7 +36,7 @@
 	 webadmin_user/4,
 	 webadmin_page/3]).
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("logger.hrl").
 -include("mod_roster.hrl").
 -include("translate.hrl").
diff --git a/src/mod_mqtt_bridge_session.erl b/src/mod_mqtt_bridge_session.erl
index 7d38632d4..0627fb55f 100644
--- a/src/mod_mqtt_bridge_session.erl
+++ b/src/mod_mqtt_bridge_session.erl
@@ -28,7 +28,7 @@
 
 -include("logger.hrl").
 -include("mqtt.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include_lib("public_key/include/public_key.hrl").
 
 -type error_reason() ::
diff --git a/src/mod_mqtt_session.erl b/src/mod_mqtt_session.erl
index 37ea8ce02..e88ea64fa 100644
--- a/src/mod_mqtt_session.erl
+++ b/src/mod_mqtt_session.erl
@@ -28,7 +28,7 @@
 
 -include("logger.hrl").
 -include("mqtt.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include_lib("public_key/include/public_key.hrl").
 
 -record(state, {vsn = ?VSN            :: integer(),
diff --git a/src/mod_mqtt_ws.erl b/src/mod_mqtt_ws.erl
index 236f0b2d7..7c1f91561 100644
--- a/src/mod_mqtt_ws.erl
+++ b/src/mod_mqtt_ws.erl
@@ -29,7 +29,7 @@
 -export([init/1, handle_call/3, handle_cast/2, handle_info/2,
 	 terminate/2, code_change/3, format_status/2]).
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("ejabberd_http.hrl").
 -include("logger.hrl").
 
diff --git a/src/mod_muc.erl b/src/mod_muc.erl
index e1da09a7e..3a8c45108 100644
--- a/src/mod_muc.erl
+++ b/src/mod_muc.erl
@@ -79,7 +79,7 @@
 	 mod_opt_type/1, mod_options/1, depends/2]).
 
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("mod_muc.hrl").
 -include("mod_muc_room.hrl").
 -include("translate.hrl").
diff --git a/src/mod_muc_admin.erl b/src/mod_muc_admin.erl
index 234f065d3..3c10fecaf 100644
--- a/src/mod_muc_admin.erl
+++ b/src/mod_muc_admin.erl
@@ -49,7 +49,7 @@
 	 get_room_pid/2, get_room_history/2]).
 
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("mod_muc.hrl").
 -include("mod_muc_room.hrl").
 -include("ejabberd_http.hrl").
diff --git a/src/mod_muc_log.erl b/src/mod_muc_log.erl
index 9e724de32..24d57a343 100644
--- a/src/mod_muc_log.erl
+++ b/src/mod_muc_log.erl
@@ -42,7 +42,7 @@
 	 mod_opt_type/1, mod_options/1, depends/2, mod_doc/0]).
 
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("mod_muc_room.hrl").
 -include("translate.hrl").
 
diff --git a/src/mod_muc_mnesia.erl b/src/mod_muc_mnesia.erl
index 4a5192d2f..ba45a2775 100644
--- a/src/mod_muc_mnesia.erl
+++ b/src/mod_muc_mnesia.erl
@@ -44,7 +44,7 @@
 
 -include("mod_muc.hrl").
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include_lib("stdlib/include/ms_transform.hrl").
 
 -record(state, {}).
diff --git a/src/mod_muc_room.erl b/src/mod_muc_room.erl
index f66e32036..6a5189efa 100644
--- a/src/mod_muc_room.erl
+++ b/src/mod_muc_room.erl
@@ -71,7 +71,7 @@
 	 code_change/4]).
 
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("translate.hrl").
 -include("mod_muc_room.hrl").
 -include("ejabberd_stacktrace.hrl").
diff --git a/src/mod_muc_rtbl.erl b/src/mod_muc_rtbl.erl
index d5fe3bbfd..e2c501e7c 100644
--- a/src/mod_muc_rtbl.erl
+++ b/src/mod_muc_rtbl.erl
@@ -27,7 +27,7 @@
 
 -behaviour(gen_mod).
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("logger.hrl").
 -include("translate.hrl").
 -include("mod_muc_room.hrl").
diff --git a/src/mod_muc_sql.erl b/src/mod_muc_sql.erl
index 1c72a5bd2..6f8425241 100644
--- a/src/mod_muc_sql.erl
+++ b/src/mod_muc_sql.erl
@@ -43,7 +43,7 @@
 -export([set_affiliation/6, set_affiliations/4, get_affiliation/5,
 	 get_affiliations/3, search_affiliation/4]).
 
--include_lib("xmpp/include/jid.hrl").
+-include_lib("p1_xmpp/include/jid.hrl").
 -include("mod_muc.hrl").
 -include("logger.hrl").
 -include("ejabberd_sql_pt.hrl").
diff --git a/src/mod_multicast.erl b/src/mod_multicast.erl
index 9b418049a..5f84feb33 100644
--- a/src/mod_multicast.erl
+++ b/src/mod_multicast.erl
@@ -45,7 +45,7 @@
 
 -include("logger.hrl").
 -include("translate.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 
 -record(multicastc, {rserver :: binary(),
 		     response,
diff --git a/src/mod_offline.erl b/src/mod_offline.erl
index 4840ced5f..629b4d15a 100644
--- a/src/mod_offline.erl
+++ b/src/mod_offline.erl
@@ -69,7 +69,7 @@
 
 -include("logger.hrl").
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 
 -include("ejabberd_http.hrl").
 
diff --git a/src/mod_offline_mnesia.erl b/src/mod_offline_mnesia.erl
index 2cd511dfa..a7bb30812 100644
--- a/src/mod_offline_mnesia.erl
+++ b/src/mod_offline_mnesia.erl
@@ -33,7 +33,7 @@
 	 remove_old_messages_batch/4]).
 -export([need_transform/1, transform/1]).
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("mod_offline.hrl").
 -include("logger.hrl").
 
diff --git a/src/mod_offline_sql.erl b/src/mod_offline_sql.erl
index a3b9d0545..bad4e45f2 100644
--- a/src/mod_offline_sql.erl
+++ b/src/mod_offline_sql.erl
@@ -32,7 +32,7 @@
 	 read_message/3, remove_message/3, read_all_messages/2,
 	 remove_all_messages/2, count_messages/2, import/1, export/1, remove_old_messages_batch/3]).
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("mod_offline.hrl").
 -include("logger.hrl").
 -include("ejabberd_sql_pt.hrl").
diff --git a/src/mod_ping.erl b/src/mod_ping.erl
index 9ac6e9bad..7b50b68c8 100644
--- a/src/mod_ping.erl
+++ b/src/mod_ping.erl
@@ -35,7 +35,7 @@
 
 -include("logger.hrl").
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 
 -include("translate.hrl").
 
diff --git a/src/mod_pres_counter.erl b/src/mod_pres_counter.erl
index 7359260bc..3772f2a9c 100644
--- a/src/mod_pres_counter.erl
+++ b/src/mod_pres_counter.erl
@@ -32,7 +32,7 @@
 
 -include("logger.hrl").
 -include("translate.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 
 -record(pres_counter,
 	{dir, start, count, logged = false}).
diff --git a/src/mod_privacy.erl b/src/mod_privacy.erl
index 37f1eb8bc..e2d0ee04d 100644
--- a/src/mod_privacy.erl
+++ b/src/mod_privacy.erl
@@ -41,7 +41,7 @@
 	 mod_opt_type/1, mod_options/1, depends/2]).
 
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("mod_privacy.hrl").
 -include("translate.hrl").
 
diff --git a/src/mod_privacy_mnesia.erl b/src/mod_privacy_mnesia.erl
index 78eeb9b82..cf0cbc754 100644
--- a/src/mod_privacy_mnesia.erl
+++ b/src/mod_privacy_mnesia.erl
@@ -32,7 +32,7 @@
 	 remove_list/3, use_cache/1, import/1]).
 -export([need_transform/1, transform/1]).
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("mod_privacy.hrl").
 -include("logger.hrl").
 
diff --git a/src/mod_privacy_sql.erl b/src/mod_privacy_sql.erl
index 10ec92e0b..241fa6792 100644
--- a/src/mod_privacy_sql.erl
+++ b/src/mod_privacy_sql.erl
@@ -34,7 +34,7 @@
 
 -export([item_to_raw/1, raw_to_item/1]).
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("mod_privacy.hrl").
 -include("logger.hrl").
 -include("ejabberd_sql_pt.hrl").
diff --git a/src/mod_private.erl b/src/mod_private.erl
index 52768291d..304dc5c25 100644
--- a/src/mod_private.erl
+++ b/src/mod_private.erl
@@ -40,7 +40,7 @@
 -export([get_commands_spec/0, bookmarks_to_pep/2]).
 
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("mod_private.hrl").
 -include("ejabberd_commands.hrl").
 -include("translate.hrl").
diff --git a/src/mod_private_mnesia.erl b/src/mod_private_mnesia.erl
index e3619dc2a..3828989d7 100644
--- a/src/mod_private_mnesia.erl
+++ b/src/mod_private_mnesia.erl
@@ -31,7 +31,7 @@
 	 use_cache/1, import/3]).
 -export([need_transform/1, transform/1]).
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("mod_private.hrl").
 -include("logger.hrl").
 
diff --git a/src/mod_private_sql.erl b/src/mod_private_sql.erl
index a1bb38c82..07772c036 100644
--- a/src/mod_private_sql.erl
+++ b/src/mod_private_sql.erl
@@ -29,7 +29,7 @@
 -export([init/2, set_data/3, get_data/3, get_all_data/2, del_data/2,
 	 import/3, export/1]).
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("mod_private.hrl").
 -include("ejabberd_sql_pt.hrl").
 -include("logger.hrl").
diff --git a/src/mod_privilege.erl b/src/mod_privilege.erl
index 3862b33c7..9d6b290c9 100644
--- a/src/mod_privilege.erl
+++ b/src/mod_privilege.erl
@@ -41,7 +41,7 @@
 	 process_presence_out/1, process_presence_in/1]).
 
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("translate.hrl").
 
 -type roster_permission() :: both | get | set.
diff --git a/src/mod_proxy65_service.erl b/src/mod_proxy65_service.erl
index 297c59bb6..124c47490 100644
--- a/src/mod_proxy65_service.erl
+++ b/src/mod_proxy65_service.erl
@@ -38,7 +38,7 @@
 	 delete_listener/1, route/1]).
 
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("translate.hrl").
 -include("ejabberd_stacktrace.hrl").
 
diff --git a/src/mod_pubsub.erl b/src/mod_pubsub.erl
index b8f4c4905..071bb3327 100644
--- a/src/mod_pubsub.erl
+++ b/src/mod_pubsub.erl
@@ -40,7 +40,7 @@
 -protocol({xep, 248, '0.2'}).
 
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("pubsub.hrl").
 -include("mod_roster.hrl").
 -include("translate.hrl").
diff --git a/src/mod_push.erl b/src/mod_push.erl
index c911bb6ac..117c6bd49 100644
--- a/src/mod_push.erl
+++ b/src/mod_push.erl
@@ -51,7 +51,7 @@
 
 -include("ejabberd_commands.hrl").
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("translate.hrl").
 
 -define(PUSH_CACHE, push_cache).
diff --git a/src/mod_push_keepalive.erl b/src/mod_push_keepalive.erl
index 9463ec7d9..bcdfb516f 100644
--- a/src/mod_push_keepalive.erl
+++ b/src/mod_push_keepalive.erl
@@ -36,7 +36,7 @@
 	 c2s_handle_cast/2, c2s_handle_info/2, c2s_stanza/3]).
 
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("translate.hrl").
 
 -define(PUSH_BEFORE_TIMEOUT_PERIOD, 120000). % 2 minutes.
diff --git a/src/mod_push_mnesia.erl b/src/mod_push_mnesia.erl
index 4e3baa342..f982991f2 100644
--- a/src/mod_push_mnesia.erl
+++ b/src/mod_push_mnesia.erl
@@ -35,7 +35,7 @@
 
 -include_lib("stdlib/include/ms_transform.hrl").
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("mod_push.hrl").
 
 %%%-------------------------------------------------------------------
diff --git a/src/mod_push_sql.erl b/src/mod_push_sql.erl
index 7a433a57d..43e8dbb19 100644
--- a/src/mod_push_sql.erl
+++ b/src/mod_push_sql.erl
@@ -31,7 +31,7 @@
 	 lookup_sessions/3, lookup_sessions/2, lookup_sessions/1,
 	 delete_session/3, delete_old_sessions/2, export/1]).
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("logger.hrl").
 -include("ejabberd_sql_pt.hrl").
 -include("mod_push.hrl").
diff --git a/src/mod_register.erl b/src/mod_register.erl
index 7b05d4fff..45dac2ca0 100644
--- a/src/mod_register.erl
+++ b/src/mod_register.erl
@@ -40,7 +40,7 @@
 -deprecated({try_register, 4}).
 
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("translate.hrl").
 
 start(Host, _Opts) ->
diff --git a/src/mod_register_web.erl b/src/mod_register_web.erl
index 03e35cbf4..cea523fae 100644
--- a/src/mod_register_web.erl
+++ b/src/mod_register_web.erl
@@ -34,7 +34,7 @@
 
 -include("logger.hrl").
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 
 -include("ejabberd_http.hrl").
 
diff --git a/src/mod_roster.erl b/src/mod_roster.erl
index 7ea3dac81..1a9933a8f 100644
--- a/src/mod_roster.erl
+++ b/src/mod_roster.erl
@@ -54,7 +54,7 @@
 	 depends/2, set_item_and_notify_clients/3]).
 
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("mod_roster.hrl").
 -include("ejabberd_http.hrl").
 -include("ejabberd_web_admin.hrl").
diff --git a/src/mod_roster_mnesia.erl b/src/mod_roster_mnesia.erl
index 3ef93a4dc..d74cb7640 100644
--- a/src/mod_roster_mnesia.erl
+++ b/src/mod_roster_mnesia.erl
@@ -37,7 +37,7 @@
 
 -include("mod_roster.hrl").
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 
 %%%===================================================================
 %%% API
diff --git a/src/mod_roster_sql.erl b/src/mod_roster_sql.erl
index 67d9697f7..a8462f5ff 100644
--- a/src/mod_roster_sql.erl
+++ b/src/mod_roster_sql.erl
@@ -38,7 +38,7 @@
 -include("mod_roster.hrl").
 -include("ejabberd_sql_pt.hrl").
 -include("logger.hrl").
--include_lib("xmpp/include/jid.hrl").
+-include_lib("p1_xmpp/include/jid.hrl").
 
 %%%===================================================================
 %%% API
diff --git a/src/mod_s2s_dialback.erl b/src/mod_s2s_dialback.erl
index cd0a9b8f6..2ddd8a9f5 100644
--- a/src/mod_s2s_dialback.erl
+++ b/src/mod_s2s_dialback.erl
@@ -33,7 +33,7 @@
 	 s2s_in_features/2, s2s_out_init/2, s2s_out_closed/2,
 	 s2s_out_tls_verify/2]).
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("logger.hrl").
 -include("translate.hrl").
 
diff --git a/src/mod_service_log.erl b/src/mod_service_log.erl
index c387ce04c..4cc818434 100644
--- a/src/mod_service_log.erl
+++ b/src/mod_service_log.erl
@@ -34,7 +34,7 @@
 
 -include("logger.hrl").
 -include("translate.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 
 start(Host, _Opts) ->
     ejabberd_hooks:add(user_send_packet, Host, ?MODULE,
diff --git a/src/mod_shared_roster.erl b/src/mod_shared_roster.erl
index 579992739..700b0c89c 100644
--- a/src/mod_shared_roster.erl
+++ b/src/mod_shared_roster.erl
@@ -43,7 +43,7 @@
 
 -include("logger.hrl").
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 
 -include("mod_roster.hrl").
 
diff --git a/src/mod_shared_roster_ldap.erl b/src/mod_shared_roster_ldap.erl
index 7c97ce011..5aaf6ff53 100644
--- a/src/mod_shared_roster_ldap.erl
+++ b/src/mod_shared_roster_ldap.erl
@@ -43,7 +43,7 @@
 	 depends/2, mod_doc/0]).
 
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("mod_roster.hrl").
 -include("eldap.hrl").
 -include("translate.hrl").
diff --git a/src/mod_shared_roster_mnesia.erl b/src/mod_shared_roster_mnesia.erl
index 447fa174d..8d700bbe7 100644
--- a/src/mod_shared_roster_mnesia.erl
+++ b/src/mod_shared_roster_mnesia.erl
@@ -37,7 +37,7 @@
 -include("mod_roster.hrl").
 -include("mod_shared_roster.hrl").
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 
 %%%===================================================================
 %%% API
diff --git a/src/mod_shared_roster_sql.erl b/src/mod_shared_roster_sql.erl
index d921e5474..a4f3cfb03 100644
--- a/src/mod_shared_roster_sql.erl
+++ b/src/mod_shared_roster_sql.erl
@@ -35,7 +35,7 @@
 	 add_user_to_group/3, remove_user_from_group/3, import/3,
 	 export/1]).
 
--include_lib("xmpp/include/jid.hrl").
+-include_lib("p1_xmpp/include/jid.hrl").
 -include("mod_roster.hrl").
 -include("mod_shared_roster.hrl").
 -include("ejabberd_sql_pt.hrl").
diff --git a/src/mod_sic.erl b/src/mod_sic.erl
index 94f82e10b..5a2389e7c 100644
--- a/src/mod_sic.erl
+++ b/src/mod_sic.erl
@@ -35,7 +35,7 @@
 	 process_sm_iq/1, mod_options/1, depends/2, mod_doc/0]).
 
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("translate.hrl").
 
 start(Host, _Opts) ->
diff --git a/src/mod_sip.erl b/src/mod_sip.erl
index 13fcfa6c4..7abdf1023 100644
--- a/src/mod_sip.erl
+++ b/src/mod_sip.erl
@@ -55,7 +55,7 @@ mod_doc() ->
 	 locate/1, mod_opt_type/1, mod_options/1, depends/2,
          mod_doc/0]).
 
--include_lib("esip/include/esip.hrl").
+-include_lib("p1_sip/include/esip.hrl").
 
 %%%===================================================================
 %%% API
diff --git a/src/mod_sip_proxy.erl b/src/mod_sip_proxy.erl
index dbd17a9d6..70d861e12 100644
--- a/src/mod_sip_proxy.erl
+++ b/src/mod_sip_proxy.erl
@@ -39,7 +39,7 @@
 	 code_change/4]).
 
 -include("logger.hrl").
--include_lib("esip/include/esip.hrl").
+-include_lib("p1_sip/include/esip.hrl").
 
 -define(SIGN_LIFETIME, 300). %% in seconds.
 
diff --git a/src/mod_sip_registrar.erl b/src/mod_sip_registrar.erl
index 970a45256..825478840 100644
--- a/src/mod_sip_registrar.erl
+++ b/src/mod_sip_registrar.erl
@@ -41,7 +41,7 @@
 	 terminate/2, code_change/3]).
 
 -include("logger.hrl").
--include_lib("esip/include/esip.hrl").
+-include_lib("p1_sip/include/esip.hrl").
 
 -define(CALL_TIMEOUT, timer:seconds(30)).
 -define(DEFAULT_EXPIRES, 3600).
diff --git a/src/mod_stats.erl b/src/mod_stats.erl
index 492a486b9..79163f03a 100644
--- a/src/mod_stats.erl
+++ b/src/mod_stats.erl
@@ -35,7 +35,7 @@
 	 mod_options/1, depends/2, mod_doc/0]).
 
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("translate.hrl").
 
 start(Host, _Opts) ->
diff --git a/src/mod_stream_mgmt.erl b/src/mod_stream_mgmt.erl
index 7b02b2e48..737f81219 100644
--- a/src/mod_stream_mgmt.erl
+++ b/src/mod_stream_mgmt.erl
@@ -37,7 +37,7 @@
 %% adjust pending session timeout / access queue
 -export([get_resume_timeout/1, set_resume_timeout/2, queue_find/2]).
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("logger.hrl").
 -include_lib("p1_utils/include/p1_queue.hrl").
 -include("translate.hrl").
diff --git a/src/mod_stun_disco.erl b/src/mod_stun_disco.erl
index 9f77cc1a8..085048017 100644
--- a/src/mod_stun_disco.erl
+++ b/src/mod_stun_disco.erl
@@ -55,7 +55,7 @@
 
 -include("logger.hrl").
 -include("translate.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 
 -define(STUN_MODULE, ejabberd_stun).
 
diff --git a/src/mod_time.erl b/src/mod_time.erl
index c954761c2..659c767fa 100644
--- a/src/mod_time.erl
+++ b/src/mod_time.erl
@@ -36,7 +36,7 @@
 	 mod_options/1, depends/2, mod_doc/0]).
 
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("translate.hrl").
 
 start(Host, _Opts) ->
diff --git a/src/mod_vcard.erl b/src/mod_vcard.erl
index 87bb22080..a6bc0fa0f 100644
--- a/src/mod_vcard.erl
+++ b/src/mod_vcard.erl
@@ -45,7 +45,7 @@
 -export([route/1]).
 
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("mod_vcard.hrl").
 -include("translate.hrl").
 -include("ejabberd_stacktrace.hrl").
diff --git a/src/mod_vcard_ldap.erl b/src/mod_vcard_ldap.erl
index b07a83cfc..29dcb5226 100644
--- a/src/mod_vcard_ldap.erl
+++ b/src/mod_vcard_ldap.erl
@@ -40,7 +40,7 @@
 
 -include("logger.hrl").
 -include("eldap.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("translate.hrl").
 
 -define(PROCNAME, ejabberd_mod_vcard_ldap).
diff --git a/src/mod_vcard_mnesia.erl b/src/mod_vcard_mnesia.erl
index f877f91bd..0bbe993c0 100644
--- a/src/mod_vcard_mnesia.erl
+++ b/src/mod_vcard_mnesia.erl
@@ -33,7 +33,7 @@
 -export([need_transform/1, transform/1]).
 -export([mod_opt_type/1, mod_options/1, mod_doc/0]).
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("mod_vcard.hrl").
 -include("logger.hrl").
 -include("translate.hrl").
diff --git a/src/mod_vcard_sql.erl b/src/mod_vcard_sql.erl
index 7d1c00e11..d770baa6a 100644
--- a/src/mod_vcard_sql.erl
+++ b/src/mod_vcard_sql.erl
@@ -32,7 +32,7 @@
 	 search_fields/1, search_reported/1, import/3, export/1]).
 -export([is_search_supported/1]).
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("mod_vcard.hrl").
 -include("logger.hrl").
 -include("ejabberd_sql_pt.hrl").
diff --git a/src/mod_vcard_xupdate.erl b/src/mod_vcard_xupdate.erl
index d169b78f4..4f244c587 100644
--- a/src/mod_vcard_xupdate.erl
+++ b/src/mod_vcard_xupdate.erl
@@ -37,7 +37,7 @@
 -export([compute_hash/1]).
 
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("translate.hrl").
 
 -define(VCARD_XUPDATE_CACHE, vcard_xupdate_cache).
diff --git a/src/mod_version.erl b/src/mod_version.erl
index 64b7ba278..5caa4231d 100644
--- a/src/mod_version.erl
+++ b/src/mod_version.erl
@@ -35,7 +35,7 @@
 	 mod_opt_type/1, mod_options/1, depends/2, mod_doc/0]).
 
 -include("logger.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("translate.hrl").
 
 start(Host, _Opts) ->
diff --git a/src/node_flat.erl b/src/node_flat.erl
index c64adb3ef..d94a84734 100644
--- a/src/node_flat.erl
+++ b/src/node_flat.erl
@@ -34,7 +34,7 @@
 -author('christophe.romain@process-one.net').
 
 -include("pubsub.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 
 -export([init/3, terminate/2, options/0, features/0,
     create_node_permission/6, create_node/2, delete_node/1,
diff --git a/src/node_flat_sql.erl b/src/node_flat_sql.erl
index 9a98fed65..66c690bf7 100644
--- a/src/node_flat_sql.erl
+++ b/src/node_flat_sql.erl
@@ -35,7 +35,7 @@
 
 
 -include("pubsub.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("ejabberd_sql_pt.hrl").
 -include("translate.hrl").
 
diff --git a/src/nodetree_tree.erl b/src/nodetree_tree.erl
index ea8d35c50..361a3734b 100644
--- a/src/nodetree_tree.erl
+++ b/src/nodetree_tree.erl
@@ -41,7 +41,7 @@
 -include_lib("stdlib/include/ms_transform.hrl").
 
 -include("pubsub.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("translate.hrl").
 
 -export([init/3, terminate/2, options/0, set_node/1,
diff --git a/src/nodetree_tree_sql.erl b/src/nodetree_tree_sql.erl
index ccb2b0e2a..6722cf44f 100644
--- a/src/nodetree_tree_sql.erl
+++ b/src/nodetree_tree_sql.erl
@@ -39,7 +39,7 @@
 
 
 -include("pubsub.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("ejabberd_sql_pt.hrl").
 -include("translate.hrl").
 
diff --git a/src/prosody2ejabberd.erl b/src/prosody2ejabberd.erl
index 951993cc0..8582d4537 100644
--- a/src/prosody2ejabberd.erl
+++ b/src/prosody2ejabberd.erl
@@ -27,8 +27,8 @@
 %% API
 -export([from_dir/1]).
 
--include_lib("xmpp/include/scram.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/scram.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("logger.hrl").
 -include("mod_roster.hrl").
 -include("mod_offline.hrl").
diff --git a/src/pubsub_subscription.erl b/src/pubsub_subscription.erl
index db947bb64..23e87e054 100644
--- a/src/pubsub_subscription.erl
+++ b/src/pubsub_subscription.erl
@@ -38,7 +38,7 @@
     read_subscription/3, write_subscription/4]).
 
 -include("pubsub.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("translate.hrl").
 
 -define(PUBSUB_DELIVER, <<"pubsub#deliver">>).
diff --git a/src/pubsub_subscription_sql.erl b/src/pubsub_subscription_sql.erl
index 839d1589c..dc336a340 100644
--- a/src/pubsub_subscription_sql.erl
+++ b/src/pubsub_subscription_sql.erl
@@ -34,7 +34,7 @@
     get_options_xform/2, parse_options_xform/1]).
 
 -include("pubsub.hrl").
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 -include("translate.hrl").
 
 -define(PUBSUB_DELIVER, <<"pubsub#deliver">>).
diff --git a/test/suite.hrl b/test/suite.hrl
index d8ea3e23b..9c6bc3f42 100644
--- a/test/suite.hrl
+++ b/test/suite.hrl
@@ -1,8 +1,8 @@
 -include_lib("common_test/include/ct.hrl").
--include_lib("fast_xml/include/fxml.hrl").
--include_lib("xmpp/include/jid.hrl").
--include_lib("xmpp/include/ns.hrl").
--include_lib("xmpp/include/xmpp_codec.hrl").
+-include_lib("p1_xml/include/fxml.hrl").
+-include_lib("p1_xmpp/include/jid.hrl").
+-include_lib("p1_xmpp/include/ns.hrl").
+-include_lib("p1_xmpp/include/xmpp_codec.hrl").
 -include("mod_proxy65.hrl").
 
 -define(STREAM_TRAILER, <<"</stream:stream>">>).
diff --git a/tools/xml_compress_gen.erl b/tools/xml_compress_gen.erl
index c3c494c8c..80ff83f79 100644
--- a/tools/xml_compress_gen.erl
+++ b/tools/xml_compress_gen.erl
@@ -24,7 +24,7 @@
 -module(xml_compress_gen).
 -author("pawel@process-one.net").
 
--include_lib("xmpp/include/xmpp.hrl").
+-include_lib("p1_xmpp/include/xmpp.hrl").
 
 %% API
 -export([archive_analyze/3, process_stats/1, gen_code/3]).
-- 
2.39.2

